import { axios } from '@/utils/request'

const api = {
    attacheList: '/admin/headquarters-attache/getPageList', //专员类型列表
    addAttacheType: '/admin/headquarters-attache/addAttacheType', //专员类型添加
    updateAttacheType: '/admin/headquarters-attache/updateAttacheType', //修改专员类型
    delAttacheType: '/admin/headquarters-attache/delAttacheType', //删除专员类型

    pageAttacheList: '/admin/headquarters-attache/pageAttacheList', //专员分页列表
    attacheAdd: '/admin/headquarters-attache/add', //会员专员新增
    getAttacheUserIds: '/admin/headquarters-attache/getAttacheUserIds/', //专员类型获取已选择的用户ID
    attacheEdit: '/admin/headquarters-attache/edit', //会员专员编辑
}

export default api

/**
  * 专员类型列表
  */
export function attacheList(data) {
    return axios({
        url: api.attacheList,
        method: 'post',
        data
    })
}

/**
  * 专员类型添加
  */
export function updateAttacheType(data) {
    return axios({
        url: api.updateAttacheType,
        method: 'post',
        data
    })
}

/**
  * 专员类型添加
  */
export function addAttacheType(data) {
    return axios({
        url: api.addAttacheType,
        method: 'post',
        data
    })
}

/**
  * 专员类型删除
  */
export function delAttacheType(dictCode) {
    return axios({
        url: api.delAttacheType + `?dictCode=${dictCode}`,
        method: 'post'
    })
}

/**
  * 会员专员列表
  */
export function pageAttacheList(data) {
    return axios({
        url: api.pageAttacheList + `?current=${data.current}&size=${data.pageSize}`,
        method: 'post',
        data
    })
}

/**
  * 会员专员新增
  */
export function attacheAdd(data) {
    return axios({
        url: api.attacheAdd,
        method: 'post',
        data
    })
}

/**
  * 专员类型获取已选择的用户ID
  */
export function getAttacheUserIds(data) {
    return axios({
        url: api.getAttacheUserIds + data,
        method: 'get'
    })
}
